<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/config.inc.php');
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/top.inc.php');

$instructor_id = $_GET['iid'];
$q = "SELECT * FROM instructors WHERE id = '$instructor_id'";
$r = mysql_query($q);
$row = mysql_fetch_assoc($r);
$instructor_fname = $row['first_name'];
$instructor_lname = $row['last_name'];


echo "<p>";
	echo "<a href='update_availability.php?id=$instructor_id'>&lt;&lt; Back to Instructor Availability</a><br />";
echo "</p>";
echo "<h1>Add Timeslot for $instructor_fname $instructor_lname</h1>";

echo "<p>Please enter time in 24 hour, HH:MM:SS format (i.e. 17:30:00)</p>";

//counting variable
//$i = 0;

//$query="SELECT * FROM instructor_availability";
//$result=mysql_query($query);

//determine dynamically number of rows read from table
//$num_rows=mysql_numrows($result);

//close
//mysql_close();



echo '<form action="add_timeslots_do.php" method="post">';

//start table
	echo "<table border ='0'>";
	
		//create table row with column ID's
		echo "<tr>";
			echo"<td><b>Day</b></td>";
			echo"<td width='80' style='text-align: center'><b>Start Time</b></td>";
			echo"<td width='80' style='text-align: center'><b>End Time</b></td>";
		echo "</tr>";
		
		echo "<tr>";
		echo "<td><select name='dow'>";
					echo "<option value='1'>Monday</option>";
					echo "<option value='2'>Tuesday</option>";
					echo "<option value='3'>wednesday</option>";
					echo "<option value='4'>Thursday</option>";
					echo "<option value='5'>Friday</option>";
					echo "<option value='6'>Saturday</option>";
					echo "<option value='7'>Sunday</option>";
				echo "</select></td>";
		//echo "<td width='80' style='text-align: center'><input type='text' name='dow'></td>";
		echo "<td width='80' style='text-align: center'><input type='text' name='start'></td>";
		echo "<td width='80' style='text-align: center'><input type='text' name='end'></td>";
	echo "</tr>";
//end table tag
echo "</table>";

echo "<input type='hidden' name='iid' value='$instructor_id'>";
echo "<p></p>";
echo '<p><input type="submit"></p>';
echo '</form>';



?>

<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/bottom.inc.php');
?>